package encore.portal.web;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import encore.log.Logger;
import encore.log.LoggerFactory;

/**
 * @author Plex
 * 实现客户端到Portal服务的请求处理
 */
public class PortalServiceFilter implements Filter {

    private static final Logger logger=LoggerFactory.getLogger(PortalServiceFilter.class);
	
    
	@Override
	public void destroy() {
		if(logger.isDebugEnabled())
		{
			logger.debug("destroying PortalServiceFilter.....");
		}

	}

	@Override
	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain filterChain) throws IOException, ServletException {
		if(logger.isDebugEnabled())
		{
			logger.debug("doFilter PortalServiceFilter");
		}
		filterChain.doFilter(request, response);
		response.getWriter().println("我的测试");
	}

	@Override
	public void init(FilterConfig filterConfig) throws ServletException {
	   if(logger.isDebugEnabled())
	   {
		   logger.debug("Initing PortalServiceFilter......");
	   }

	}

}
